<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/WEB-INF/facelets/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"                 
                xmlns:f="http://java.sun.com/jsf/core">

	<ui:param name="title" value="Admin - Create News"/>

	<ui:define name="header">
		<p><b> Show and create news </b></p>

	</ui:define>

	<ui:define name="pageContents">
		<h:form>
			<p>
			<p:dataTable var="news" value="#{viewNewsControllerBean.news}">

				<p:column sortBy="#{news.getID}">
					<f:facet name="header">
						<h:outputText value="NewsID" />
					</f:facet>
					<h:outputText value="#{news.getID}" />
				</p:column>

				<p:column sortBy="#{news.getMessage}">
					<f:facet name="header">
						<h:outputText value="Message" />
					</f:facet>
					<h:outputText value="#{news.getMessage}" />
				</p:column>

				<p:column sortBy="#{news.getDate}">
					<f:facet name="header">
						<h:outputText value="Date" />
					</f:facet>
					<h:outputText value="#{news.getDate}" />
				</p:column>


			</p:dataTable>


			</p>
			
			<p>
			<h:panelGrid columns="3" >
				<h:outputLabel value="New:"/>
				<h:inputText id="newNews" value="" />
				
				<h:commandButton value="Submit!" action="#{tjolahoppBean}" />
			</h:panelGrid>
				
			</p>

		</h:form>
	</ui:define>

</ui:composition>